package com.jtyoui.hdfs;

import java.io.File;
import java.io.IOException;

import com.jtyoui.path.Address;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

public class UploadFile {

    public static void main(String[] args) throws IOException {
        System.setProperty("HADOOP_USER_NAME", "hadoop");
        Configuration conf = new Configuration();
        FileSystem fs = FileSystem.get(conf);
        Path src = new Path( new File("src/main/resources").getAbsolutePath()+"/core-site.xml");
        Path dst = new Path(Address.HADOOP_PATH.toString() + "/data/");
        fs.copyFromLocalFile(src, dst);
        fs.close();
    }
}

